package com.nidu.demo.oauth2.convertor;

import com.nidu.demo.base.BaseConvertor;
import com.nidu.demo.convertor.MapStructConfig;
import com.nidu.demo.oauth2.dto.OAuth2ClientCO;
import com.nidu.demo.oauth2.mapper.dataobject.OAuth2ClientDO;
import com.nidu.demo.oauth2.model.OAuth2Client;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(config = MapStructConfig.class)
public interface OAuth2ClientConvertor extends BaseConvertor<OAuth2ClientDO, OAuth2Client, OAuth2ClientCO> {

    @Override
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    @Mapping(target = "updateBy", ignore = true)
    OAuth2ClientDO toDataObject(OAuth2Client token);
}